load("@rules_cc//cc:cc_library.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

# Copied from https://gitlab.freedesktop.org/mesa/mesa/-/blob/ba92104b564514117a0bcc4120dff6089965eabc/include/GL/gl.h
# Because:
#   - gl.h was removed from OpenGL-Registry
#   - Many applications use and depend on this header.
#   - Mesa maintains a version of gl.h that works well.
cc_library(
    name = "gl_h",
    hdrs = ["gl.h"],
    include_prefix = "GL",
)

cc_library(
    name = "OpenGL_headers",
    hdrs = glob(["api/GL/**"]),
    includes = ["api"],
    deps = [":gl_h"],
)

cc_library(
    name = "GLES2_headers",
    hdrs = glob(["api/GLES2/**"]),
    includes = ["api"],
)

cc_library(
    name = "GLES3_headers",
    hdrs = glob(["api/GLES3/**"]),
    includes = ["api"],
)
